package com.gms.action;

import java.util.List;
import java.util.Map;

import org.apache.struts2.interceptor.RequestAware;

import com.gms.domain.Product;
import com.gms.service.ProductService;
import com.opensymphony.xwork2.ActionSupport;

public class FindRealProductByBigProperty extends ActionSupport implements RequestAware{

	private ProductService productService;
	private String bigProperty;
	private Map<String,Object> request;
	
	
	public String getBigProperty() {
		return bigProperty;
	}
	public void setBigProperty(String bigProperty) {
		this.bigProperty = bigProperty;
	}
	public ProductService getProductService() {
		return productService;
	}
	public void setProductService(ProductService productService) {
		this.productService = productService;
	}


	@Override
	public String execute() throws Exception {
		bigProperty = new String(bigProperty.getBytes("iso-8859-1"),"utf-8");
		System.out.println(bigProperty);
		List<Product> productList = productService.findAllRealProductByBigProperty(bigProperty);
		
		request.put("productList", productList);
		return super.execute();
	}
	@Override
	public void setRequest(Map<String, Object> request) {
		// TODO Auto-generated method stub
		this.request = request;
	}

	
	
}
